package com.gome.axwl.aoc.service.impl;

import com.gome.axwl.aoc.dao.CsBasicInfoDao;
import com.gome.axwl.aoc.entity.po.CsBasicInfoPo;
import com.gome.axwl.aoc.service.CsBasicInfoService;
import com.gome.datasource.shard.annotation.ReadDatasource;
import com.gome.datasource.shard.annotation.WriteDatasource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description:
 * @Auther: yinyuxin@gome.com.cn
 * @Date: 2018/7/16 10:54
 */
@Service("csBasicInfoService")
public class CsBasicInfoServiceImpl implements CsBasicInfoService {

    @Autowired
    private CsBasicInfoDao csBasicInfoDao;

    @Override
    @ReadDatasource
    public CsBasicInfoPo queryById(Integer id) {
        return csBasicInfoDao.selectByPrimaryKey(id);
    }

    @Override
    @WriteDatasource
    public void insert(CsBasicInfoPo csBasicInfoPo) {
        csBasicInfoDao.insertSelective(csBasicInfoPo);
    }

    @Override
    @WriteDatasource
    public void update(CsBasicInfoPo csBasicInfoPo) {
        csBasicInfoDao.updateByPrimaryKeySelective(csBasicInfoPo);
    }

}
